<style>
	.layui-container{
		width:100%;
	}
	.layui-card,layui-row{
		margin:10px;
	}
	.layui-card table tr td:nth-child(2){
		font-weight:700;
	}
	</style>
	<div class="layui-container layui-bg-gray">
		<div class="layui-row">
			<div class="layui-col-md4">
				<div class="layui-card">
					<div class="layui-card-header"><i class="fa fa-fire icon"></i> 客户信息</div>
					<div class="layui-card-body">
					  
					<table class="layui-table">
						<colgroup>
							<col width="100">
							<col>
						</colgroup>
						<tbody>
							<tr>
								<td>名称</td>
								<td>{$clues.name}</td>
							</tr>
							<tr>
								<td>联系电话</td>
								<td>{$clues.phone}</td>
							</tr>
							<tr>
								<td>备注</td>
								<td>{$clues.remark}</td>
							</tr>
						</tbody>
					</table>				
					</div>
				</div>
			</div>
			<div class="layui-col-md8">
				<div class="layui-card">
					<div class="layui-card-header"><i class="fa fa-fire icon"></i> 跟进操作</div>
					<div class="layui-card-body">
						<form class="layui-form layui-form-pane layuimini-form">
							<div class="layui-form-item">
								<div class="layui-form-item layui-form-text">
									<label class="layui-form-label">跟进内容:</label>
									<div class="layui-input-block">
										<textarea name="content" lay-verify="required" class="layui-textarea"
											placeholder=""></textarea>
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">下次跟进时间:</label>
									<div class="layui-input-inline">
										<input type="text" name="next_time" data-date="" data-date-type="datetime" class="layui-input" autocomplete="off">
									</div>
									<div class="layui-form-mid layui-word-aux">如不需要再跟进 可设置为空</div>
								</div>
	
								<div class="layui-form-item">
									<label class="layui-form-label">跟进方式:</label>
									<div class="layui-input-inline">
										<select name="record_type" lay-verify="required">
											{volist name="record_methods" id="name" key="id"}
											<option value="{$id}">{$name}</option>
											{/volist}
										</select>
									</div>
								</div>
								<div class="layui-form-item">
								<div class="layui-input-block">
										<button class="layui-btn layui-btn-normal" lay-submit="{:url('clues.record/add',['cid'=>$clues.id,'type'=>'clues'])}" lay-filter="saveBtn">立即保存</button>
										<button type="reset" class="layui-btn layui-btn-primary">重置信息</button>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<div class="layui-row">
			<div class="layui-col-md12">
				<div class="layui-card">
					<div class="layui-card-header">
						<i class="fa fa-fire icon"></i> 跟进记录
					</div>
					<div class="layui-card-body">
						<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
					</div>
				</div>	
			</div>
		</div>
	</div>
	
	<script>
	
		layui.use(['form','jquery', 'layer','table'], function () {
			var form = layui.form,
				layer = layui.layer,
				table = layui.table,
				$ = layui.jquery;
	
				table.render({
					elem: '#currentTableId',
					url: '/crm/clues.record/index',
					cols: [[
						{ field: 'id', title: 'ID', sort: true },
						{ field: 'content', title: '内容' },
						{ field: 'create_user',title: '创建人',templet:function(d){return d.create_user.username} },
						{ field: 'record_type', title: '跟进类型' },
						{ field: 'create_time', title: '创建时间' },
						{ field: 'next_time', title: '下次跟进' }
					]],
					page: true
				});
				// 新增跟进记录
				
		});
	</script>